import Vue from 'vue'
import VueRouter from 'vue-router'
import Welcome from '../views/Welcome.vue'
import MenuRoute from '../components/MenuRoute.vue'
import Goods from '../views/goods/Goods.vue'
import Brand from '../views/goods/Brand.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: MenuRoute,
    redirect: '/welcome',
    children: [
      {
        path: '/welcome',
        name: 'welcome',
        component: Welcome
      },
      {
        path: '/goods',
        name: 'goods',
        component: Goods
      },
      {
        path: '/brands',
        name: 'brand',
        component: Brand
      }
    ]
  }
]

const router = new VueRouter({
  routes
})
router.beforeEach((to, from, next) => {
  next()
})
export default router
